import Cookies from 'js-cookie';

const TokenKey = 'accessToken';
const userInfoKey = 'userInfo';
const routerKey = "routers";

export function getToken() {
  return Cookies.get(TokenKey);
};

export function setToken(token) {
  return Cookies.set(TokenKey, token);
};

export function removeToken() {
  return Cookies.remove(TokenKey);
};

export function getUserInfo() {
  return Cookies.get(userInfoKey);
};

export function setUserInfo(userInfo) {
  return Cookies.set(userInfoKey, JSON.stringify(userInfo));
};

export function removeUserInfo() {
  return Cookies.remove(userInfoKey);
};
export function getRouters() {
  return Cookies.get(routerKey);
};

export function setRouters(routers) {
  return Cookies.set(routerKey, JSON.stringify(routers));
};

export function removeRouters() {
  return Cookies.remove(routerKey);
};